<h1 class="body-box-title"><?php echo ucfirst($this->categoryType); ?> Categories</h1>
<p>There is your <?php echo $this->categoryType; ?> categories.</p>
<div class="category-index-add">
	<form id="add-category-form" method="post" action="<?php echo $this->url(array('action' => 'add', 'controller' => 'category', 'module' => 'home', 'type' => $this->categoryType), NULL, TRUE);?>">
		<span>Name: <input type="text" name="name" size="24" maxlength="20" id="new-category-input" class="category-input" /></span>
		<span class="noDisplay">Type: <select name="parent" id="category-select-parent" size="1">
			<option value="0" selected>Top Category</option>
			<?php foreach ($this->categories as $category) {
				echo '<option value="' . $category['categoryID'] . '">' . $category['categoryName'] . '</option>' . PHP_EOL;
			} ?>
		</select>
		</span>
		<input type="submit" name="submit" id="category-submit" value="Add Category" />
	</form>
</div>
<div class="category-row-box-title">
	<p class="category-name"><strong>Category Name</strong></p>
	<p class="category-count"><strong>Counts</strong></p>
	<p class="category-create"><strong>Create Time</strong></p>
	<p class="category-update"><strong>Last Update Time</strong></p>
	<p class="category-delete"><strong>Delete</strong></p>
</div>
<?php foreach ($this->categories as $category) { ?>
<div class="category-row-box" id="category-row-<?php echo $category['categoryID']; ?>">
	<p class="category-name"><?php echo $category['categoryName']; ?></p>
	<p class="category-count"><?php echo $category['categoryCounts']; ?></p>
	<p class="category-create"><?php echo date('Y-m-d H:i A D', $category['categoryCreated']); ?></p>
	<p class="category-update"><?php echo date('Y-m-d H:i A D', $category['categoryUpdated']); ?></p>
	<p class="category-delete">
		<?php if(!$category['categoryDeleted']) { ?>
		--
		<?php } else { ?>
		<a class="delete-category-link" title="<?php echo $category['categoryName']; ?>" name="<?php echo $category['categoryID']; ?>" href="<?php echo $this->url(array('action' => 'delete', 'controller' => 'category', 'module' => 'home', 'category_id' => $category['categoryID']), NULL, TRUE);?>">Delete</a>
		<?php } ?>
	</p>
</div>
<?php } ?>